<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li {
            width: 500px;
            height: 50px;
            background-color: rgb(136, 138, 58);
            margin-top: 10px;
        }
    </style>
</head>

<body>
    <div id="app">
        <button @click="addArr">添加一个li</button>
        <ul>
            <li v-for="oli in arr">
                {{oli}}
            </li>
        </ul>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.7/vue.js"></script>
    <script>
        const vm = new Vue({
            el: "#app",
            data: {
                arr: [1, 2, 3, 4]
            },
            methods:{
                addArr(){
                    this.arr.push(this.arr.length+1)
                }
            }
        })
    </script>
</body>

</html>